loader: Propagate OOM from loader_add_to_ext_list in two call sites#1911
Merged
charles-lunarg merged 1 commit intoJun 1, 2026
Merged
Conversation
loader_add_to_ext_list() returns VkResult and documents that VK_ERROR_OUT_OF_HOST_MEMORY signals allocation failure, but two call sites discarded the return value entirely: 1. loader_read_layer_json() – when appending an instance extension from a layer's JSON manifest the OOM path silently drops the extension and continues. The device-extension block directly below it correctly checks the analogous loader_add_to_dev_ext_list() return value; bring instance-extension parsing in line with it. 2. terminator_EnumerateInstanceExtensionProperties() – when merging implicit-layer extensions into the local list the return value was ignored. On allocation failure the function continues with an incomplete list and returns VK_SUCCESS to the application, violating the Vulkan spec guarantee that a successful count query returns the full set of available extensions. Capture the return value in both sites and propagate VK_ERROR_OUT_OF_HOST_MEMORY via the existing 'goto out' paths. Fixes: silent OOM swallowing in loader_read_layer_json Fixes: silent OOM swallowing in terminator_EnumerateInstanceExtensionProperties Reviewed-by: (pending)
|
Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build. |
charles-lunarg
approved these changes
Jun 1, 2026
|
CI Vulkan-Loader build queued with queue ID 752281. |
|
CI Vulkan-Loader build # 3496 running. |
|
CI Vulkan-Loader build # 3496 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
loader_add_to_ext_list() returns VkResult and documents that VK_ERROR_OUT_OF_HOST_MEMORY signals allocation failure, but two call sites discarded the return value entirely:
loader_read_layer_json() – when appending an instance extension from a layer's JSON manifest the OOM path silently drops the extension and continues. The device-extension block directly below it correctly checks the analogous loader_add_to_dev_ext_list() return value; bring instance-extension parsing in line with it.
terminator_EnumerateInstanceExtensionProperties() – when merging implicit-layer extensions into the local list the return value was ignored. On allocation failure the function continues with an incomplete list and returns VK_SUCCESS to the application, violating the Vulkan spec guarantee that a successful count query returns the full set of available extensions.
Capture the return value in both sites and propagate VK_ERROR_OUT_OF_HOST_MEMORY via the existing 'goto out' paths.
Fixes: silent OOM swallowing in loader_read_layer_json
Fixes: silent OOM swallowing in terminator_EnumerateInstanceExtensionProperties
Reviewed-by: (pending)